Skip to content

Make ActivationRegistrationManager.RegisterForFileTypeActivation() case-insensitive for paths#8

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-7
Draft

Make ActivationRegistrationManager.RegisterForFileTypeActivation() case-insensitive for paths#8
Copilot wants to merge 3 commits intomainfrom
copilot/fix-7

Conversation

Copy link
Copy Markdown

Copilot AI commented May 22, 2025

Overview

This PR fixes an issue where RegisterForFileTypeActivation() would create duplicate registry entries if the same path was specified with different casing (e.g., "app.exe" vs "App.exe"). This caused problems with single instancing when applications were registered with file paths whose case differed from the actual file system.

Solution

The issue was identified in the ComputeAppId() function which creates a hash from the provided executable path. This hash is used to generate registry entries, but the function wasn't normalizing the case of file paths before hashing.

Changes made:

  • Modified ComputeAppId() to detect if the input is a file path
  • For file paths, normalize to lowercase before hashing to ensure case-insensitivity
  • Added a unit test FileTypeActivation_CaseInsensitivity to verify paths differing only by case produce the same AppId

Testing

Added a specific test case that:

  1. Creates two paths that differ only by case
  2. Calls ComputeAppId() on both paths
  3. Verifies they produce identical hashes/AppIds

This ensures that when applications register with file paths that differ only in case, they will create the same registry entry, maintaining proper single instancing behavior.

Fixes #7.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] ActivationRegistrationManager.RegisterForFileTypeActivation() - path parameter is case sensitive Make ActivationRegistrationManager.RegisterForFileTypeActivation() case-insensitive for paths May 22, 2025
Copilot AI requested a review from MuyuanMS May 22, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ActivationRegistrationManager.RegisterForFileTypeActivation() - path parameter is case sensitive

2 participants